{% extends "double.html" %}

{% block title %}{{ page_title }}{% endblock %}
{% block styles %}
    <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}styles/favoritelist.css">
{% endblock %}
{% block scripts %}
    <script type="text/javascript">
        $(document).ready(function(){
            var sectionheight = $('section').height();
            $('aside').height(sectionheight);
        })
    </script>
{% endblock %}

{% block main %}    
    
	<div class="privatemsglist">
        <h3>我的收藏</h3>
        <div class="message">
        {% if messages %}
            <ul class="messages">
                {% for message in messages %}
                    <li>{{ message }}</li>
                {% endfor %}
            </ul>   
            {% endif %}
        </div>
        <ul>
            {% if favoritelist %}
                {% for fav in favoritelist %}
                    <li>
                        <div class="avatar50">
                            <img src="{{ MEDIA_URL }}avatar/50/{{ fav.favtweet.user.profile.avatar }}">
                        </div>
                        <div class="profile">
                            <strong>
                                <a href="{% url mblog_user_index fav.favtweet.user.username %}">@{{ fav.favtweet.user.username }}</a>
                            </strong> 
                            <br />
                            <em>收藏 ({{ fav.favuser.count }})</em>
                        </div>

                        <div class="privatemsgshort">
                            <div class="precontent">{{ fav.favtweet|striptags|urlize }}</div>

                            {% if fav.favtweet.orginmessage %}
                                <div class="preorgincontent">
                                    {{ fav.favtweet.orginmessage|urlize }}
                                </div> 
                            {% endif %}
                            <em>{{ fav.addtime_format_admin }}</em>
                            <div class="clear"></div>
                        </div>
                        <div class="operating">
                            <a href="{% url mblog_favorite_del user.username fav.id %}">删除</a>
                        </div>
                        <div class="clear"></div>
                    </li>
                {% endfor %}
            {% else %}
                <li class="nonetweet"><a href="{% url mblog_home %}">你还没有收藏，赶快去收藏吧</a></li>
            {% endif %}
        </ul>
    </div> 
{% include 'include/paginator.html' %}
{% endblock %}
{% block aside %}
    <div class="userinfo">
        <div class="asideavatar50">
            <img src="{{ MEDIA_URL }}avatar/50/{{ user.profile.avatar }}" class="img_avatar" alt="我的头像" />
        </div>
        <a href="{{ taruser.profile.get_user_index_url }}">{{ user.username }}</a>
        <div class="clear"></div>
    </div>

    <ul id="user_stats">
        <li><a href="{% url mblog_followers user.username %}"><span class="count">{{ user.follower_set.count }}</span><span class="label">关注者</span></a></li>
        <li><a href="{% url mblog_fans user.username %}"><span class="count">{{ user.fan_set.count }}</span><span class="label">粉丝</span></a></li>
        <li><a href="{% url mblog_user_index user.username %}"><span class="count">{{ user.tweet_set.count }}</span><span class="label">消息</span></a></li>
        <li><a href="{% url mblog_favoritelist user.username %}"><span class="count">{{ user.favorite_set.count }}</span><span class="label">收藏</span></a></li>
    </ul>
{% endblock %}
